<?php

/*
 *
 *
 */
ob_implicit_flush(true);
require_once(dirname(__FILE__) . '/../include.all.php');


$timer = Tick::getInstance();
$timer->addEventListener('tick', function(Event $event) {
            static $i = 0;
            echo 'first: ' . $i++;
            //var_dump($event);
            echo '<hr />';
            if ($i == 5) {
                $event->target->removeEventListener($event->type, $event->callee);
            }
        });
$timer->addEventListener('tick', function(Event $event) {
            static $i = 0;
            echo 'second: ' . $i++;
            //var_dump($event);
            echo '<hr />';
            if ($i == 3) {
                $event->target->removeEventListener($event->type, $event->callee);
            }
        });

$timer->startExecution();
